<?php
	header ('Content-type: text/html; charset=utf-8');
	session_start();
	if(isset($_GET['menuid'])){
		$csspagelong = $_GET['menuid'];
	}
	else{
		$csspagelong = 0;
	}
	if(!isset($_SESSION['user']))
	{
		echo "<meta HTTP-EQUIV='refresh' content='0;url=login.html'>";
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>หกจ.ดอนกลาง</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
	<link href="css/cssie.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/myFunction.js" type="text/javascript"></script>

<link rel="stylesheet" href="css/autocomplete.css" type="text/css" media="screen" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/dimensions.js" type="text/javascript"></script>
<script src="js/autocomplete.js" type="text/javascript"></script>




<script type="text/javascript">
$(function(){
	$("#loginButton").click(function(){
//alert("asdf");
		$.post("login.php",{tUsername: $("#tUsername").val(), tPassword: $("#tPassword").val()}, function(data) {
			if(data.err=="") $("#loginBox").html(data.text);
			else $("#loginError").html(data.err);
		},"json");
	});
})
</script>
</head>

<body>

<center>
<div class="main">
	<div class="header" style="height: 145px" align="right">
	<div class="searchbox">
	<form method="post" action="index.php" name="frm_search">
  
			        <input type="text" name="T1" size="20" />
		          <input type="submit" name="send" value=" Search "/>
	</form>
	</div>
	</div>
	<div class="menu">
		<a href="index.php">Home</a>
		<a href="#"></a>
		<a href="#"></a>
		<a href="#"></a>
		<a href="#"></a>
		<a href="#"></a>
	</div>
	<div class="nav">
		<div class="box">
			<div class="boxtitle">บางแพ</div>
			<div class="boxcontent">
				<ul class="productLists">
					<li>
						<a href="?menu=showproduct">ดูข้อมูลสินค้า</a>
					</li>
					<li>สต๊อกสินค้า
					<ul>
						<li><a href="?menu=checkin">ของเข้า</a></li>
						<li><a href="?menu=checkout">ของออก</a></li>
						<li><a href="?menu=sellout">ขายออก</a></li>
					</ul>
					</li>
					<li>จัดการสินค้า<ul>
						<li><a href="?menu=addproduct">เพิ่มสินค้าใหม่</a></li>
						<li><a href="?menu=editproduct">แก้ไขข้อมูลสินค้า</a></li>
					</ul>
					</li>
				</ul>
			</div>
		</div>
		
	</div>

	<div class="content" <?php if($csspagelong==1 || $csspagelong==2 || $csspagelong==4 || $csspagelong==6) echo "style='height: 650px;'"; ?>>	
	<?php
		if($_GET['menu']=="" && $_GET['group']=="")include("home.php");
		switch($_GET['menu']){
			case "showproduct": include("showProduct.php"); break;
			case "checkin": include("checkIn.php"); break;
			case "checkout": include("checkOut.php"); break;
			case "sellout": include("sellOut.php"); break;
			case "addproduct": include("addProduct.php"); break;
			case "confermadd": include("confermAdd.php"); break;
			case "editproduct": include("editProduct.php"); break;
			//default : include("home.php");
		}	
	?>
	</div>
	<div class="footer">Copyright &copy; 2010 DonKlang All Right Reserved</div>
</div>
</center>

</body>

</html>
